updating oE bytes_to_int

bytes_to_int

include convert.e 
namespace convert 
public function bytes_to_int(sequence s) 

converts a sequence of at most 4 bytes into an atom.

Parameters:
  1. s : the sequence to convert
Returns:

An atom, the value of the concatenated bytes of s.

Comments:

This performs the reverse operation from int_to_bytes

An atom is being returned, because the converted value may be bigger than what can fit in an Euphoria integer.

Example 1:
atom int32 
 
int32 = bytes_to_int({37,1,0,0}) 
-- int32 is 37 + 256*1 = 293 
See Also:

bits_to_int, float64_to_atom, int_to_bytes, peek, peek4s, peek4u, poke4

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu